<template>
  <div class="item">
    <div class="lf">
      <span>{{ data.name }}</span>
      <span>{{ data.address | substr }}</span>
    </div>
    <div class="rt">
      <div>
        <i>￥ </i>
        <span>{{ lowPrice(data.lowPrice) }} 起</span>
      </div>
      <div><strong>距离未知</strong></div>
    </div>
  </div>
</template>

<script>
export default {
  props: ['data'],
  methods: {
    lowPrice(value) {
      return (value / 100).toFixed(0)
    }
  }
}
</script>

<style lang="scss" scoped>
.item {
  display: flex;
  .lf {
    display: flex;
    flex-direction: column;
    flex: 1;
    span:nth-of-type(1) {
      color: #191a1b;
      font-size: 15px;
    }
    span:nth-of-type(2) {
      color: #797d82;
      font-size: 12px;
      margin-top: 5px;
      /* 通过css完成超过指定宽度后，带省略号的功能 */
      /* max-width: 80%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap; */
    }
  }
  .rt {
    width: 60px;
    margin-left: 3px;
    div:nth-of-type(1) {
      font-size: 14px;
      color: #ff5f16;
    }
    div:nth-of-type(2) {
      font-size: 11px;
      color: #797d82;
    }
  }
}
</style>
